{% extends "base.html" %}
{% block title %} Blog {{ user.username }}{% endblock %}
{% import "_macros.html" as macros %}

{% block page_content %}
<!--<table>
     <tr valign="top">
       <td><img src="../static/Dragon.ico" style="width:128px;height: 128px"></td>
        <td><h1>{{user.username}}</h1></td>
    </tr>
</table>
<hr>-->
<style>

</style>
<div class="page-header" style="margin: 70px 0 ;width: 75%" >
    <img src="{{ user.gravatar(size=256) }}" class="img-rounded profile-thumbnail">
    <div class="profile-header">
    <h3  rgba(233,93,242,0.88)">用户：{{ user.username }}</h3>
    {% if user.name or user.location %}
    <p style="color: rgba(48, 18, 58, 0.74);font: bold 12px/30px Georgia,serif;">
        {% if user.name %}{{ user.name }}{% endif %}
        {% if user.location %}
            来自于 <a href="http://maps.baidu.com/?q={{ user.location }}">{{ user.location }}</a>
        {% endif %}
    </p>

    {% endif %}
    {% if current_user.is_administrator() %}
    <p><a href="mailto:{{ user.email }}">{{ user.email }}</a></p>
    {% endif %}
    {% if user.about_me %}<p>个人简介：{{ user.about_me }}</p>{% endif %}
        {% if user==current_user %}
        <a class="btn btn-default" href="{{ url_for('.edit_profile') }}">编辑简介</a>
        {% endif %}
        {% if current_user.is_administrator() %}
        <a class="btn btn-danger" href="{{ url_for('.edit_profile_admin', id=user.id) }}">编辑资料[管理员]</a>
    {% endif %}
    <p>注册于：{{ moment(user.member_since).format('L') }}. 最后浏览：{{ moment(user.last_seen).fromNow() }}.</p>
         <p>
            {% if current_user.can(Permission.FOLLOW) and user != current_user %}
                {% if not current_user.is_following(user) %}
                <a href="{{ url_for('.follow', username=user.username) }}" class="btn btn-primary">关注</a>
                {% else %}
                <a href="{{ url_for('.unfollow', username=user.username) }}" class="btn btn-default">取消关注</a>
                {% endif %}
            {% endif %}
            <a href="{{ url_for('.followers', username=user.username) }}">被关注: <span class="badge">{{ user.followers.count() }}</span></a>
            <a href="{{ url_for('.followed_by', username=user.username) }}">关注: <span class="badge">{{ user.followed.count() }}</span></a>
            {% if current_user.is_authenticated and user != current_user and user.is_following(current_user) %}
            | <span class="label label-default">关注了你</span>
            {% endif %}
        </p>
       </div>
</div>
<div style=" width: 75%">
<h3>{{ user.username }}'s 随笔</h3>

{% include '_posts.html' %}
</div>
{% if pagination %}
<div class="pagination">
    {{ macros.pagination_widget(pagination, '.user', username=user.username) }}
</div>
{% endif %}
{% endblock %}

